﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ITAP.ShprossesBuilder.Modelling.Components;
using ITAP.ShprossesBuilder.Editor;
using ITAP.ShprossesBuilder.Properties;

namespace ITAP.ShprossesBuilder.Operations
{
    public class OperationShowAllModelComponents : IOperation
    {
        #region IOperation Members

        public string Name
        {
            get { return "Показать список элементов модели"; }
        }

        public OperationGroup OperationGroup
        {
            get { return OperationGroup.Other; }
        }

        public System.Drawing.Image Thumbnail
        {
            get { return Resources.ShowModelComponents.ToBitmap(); }
        }

        public void Execute(ModelControl modelControl)
        {
            ModelCell cell = modelControl.ModelContainer.ActiveCell as ModelCell;
            if(cell == null)
                return;
            ShowModelComponentsForm componentsForm = new ShowModelComponentsForm(cell.Model.AllInnerComponents);
            componentsForm.ShowDialog();
        }

        public bool CanUndo
        {
            get { return false; }
        }

        #endregion
    }
}
